package com.xjrsoft.module.app.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.xjrsoft.common.page.PageOutput;
import com.xjrsoft.module.app.dto.AppFunctionListDto;
import com.xjrsoft.module.app.entity.XjrAppFunction;
import com.xjrsoft.module.app.entity.XjrAppFunctionButton;
import com.xjrsoft.module.app.entity.XjrAppFunctionColumn;
import com.xjrsoft.module.app.entity.XjrAppFunctionForm;
import com.xjrsoft.module.app.vo.AppFunctionVo;
import com.xjrsoft.module.app.vo.FunctionOtherVo;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * APP端功能模块管理表 服务类
 * </p>
 *
 * @author jobob
 * @since 2021-02-23
 */
public interface IXjrAppFunctionService extends IService<XjrAppFunction> {

    List<XjrAppFunction> getAppModuleList();

    /**
     * 获取app当前登录用户的授权菜单
     * @return
     */
    List<AppFunctionVo> getAppModuleForCurrentUser();

    List<AppFunctionVo> getAllAppModule();

    List<AppFunctionVo> getAppModuleByType(String type);

    PageOutput<AppFunctionVo> getPageList(AppFunctionListDto listDto);

    List<XjrAppFunction> getAuthFuncForCurUser(String type);

    boolean saveAppFunction(XjrAppFunction function,
                            List<XjrAppFunctionButton> buttonList,
                            List<XjrAppFunctionColumn> columnList,
                            List<XjrAppFunctionForm> formList);

    boolean updateAppFunction(String id,
                              XjrAppFunction function,
                              List<XjrAppFunctionButton> buttonList,
                              List<XjrAppFunctionColumn> columnList,
                              List<XjrAppFunctionForm> formList);

    List<FunctionOtherVo> getFunctionSubAuth();

    List<XjrAppFunction> getAuthFunctionListByObject(String objectId, Integer objectType);

    boolean saveFunction(XjrAppFunction function,
                         String prefixEnCode,
                         List<Map<String, Object>> buttonList,
                         List<Map<String, Object>> columnList,
                         List<Map<String, Object>> formList);
}
